//
// Created by 60946 on 2022/9/14.
//
#include <iostream>
#include <cstring>
#include <vector>

#ifndef ALGORITHM_22_1_SLN_L_Q2558_H
#define ALGORITHM_22_1_SLN_L_Q2558_H

using namespace std;


class Sln_L_Q2558 {
private:
    const vector<vector<int>> d = {{1,  0},
                                   {-1, 0},
                                   {0,  1},
                                   {0,  -1}};
    const vector<vector<int>> hr = {{1,  2},
                                    {1,  -2},
                                    {2,  1},
                                    {2,  -1},
                                    {-1, 2},
                                    {-1, -2},
                                    {-2, 1},
                                    {-2, -1}};
    const vector<vector<int>> nhr = {{1,  1},
                                     {1,  -1},
                                     {1,  1},
                                     {1,  -1},
                                     {-1, 1},
                                     {-1, -1},
                                     {-1, 1},
                                     {-1, -1}};
    char board[15][15]{};
    struct stmt {
        int x, y;
    } black[10];
    int N, bg_x, bg_y;

    bool isValid(int &x, int &y) {
        return x >= 1 && x <= 10 && y >= 1 && y <= 9;
    }

    bool isGeneralValid(int &x, int &y) {
        return x >= 1 && x <= 3 && y >= 4 && y <= 6;
    }

    bool flyingGeneral(int &x, int &y) {
        for (int i = x + 1; i <= 10; i++) {
            if (board[i][y] == '\0') continue;
            if (board[i][y] != 'G') return false;
            return true;
        }
        return false;
    }

    bool checkStmt(stmt &st) {
        return checkStmt(st.x, st.y);
    }

    bool checkStmt(int &x, int &y) {
        if (flyingGeneral(x, y)) return false;
        for (int i = 0; i < 4; i++) {
            int x1 = x + d[i][0];
            int y1 = y + d[i][1];
            while (isValid(x1, y1)) {
                if (board[x1][y1] == '\0') {
                    x1 += d[i][0];
                    y1 += d[i][1];
                    continue;
                }
                if (board[x1][y1] == 'R') return false;
                int x2 = x1 + d[i][0];
                int y2 = y1 + d[i][1];
                while (isValid(x2, y2)) {
                    if (board[x2][y2] == '\0') {
                        x2 += d[i][0];
                        y2 += d[i][1];
                        continue;
                    }
                    if (board[x2][y2] == 'C') return false;
                    break;
                }
                break;
            }
        }
        for (int i = 0; i < 8; i++) {
            int x1 = x + hr[i][0];
            int y1 = y + hr[i][1];
            int nx1 = x + nhr[i][0];
            int ny1 = y + nhr[i][1];
            if (isValid(x1, y1) && board[x1][y1] == 'H' && board[nx1][ny1] == '\0') {
                return false;
            }
        }
        return true;
    }


public:
    Sln_L_Q2558() {
        while (cin >> N >> bg_x >> bg_y) {
            if (!N && !bg_x && !bg_y) break;
            memset(board, 0, sizeof(board));
            char ch[20];
            int cnt = 0;
            int _x, _y;
            for (int i = 0; i < N; i++) {
                cin >> ch >> _x >> _y;
                board[_x][_y] = ch[0];
            }

            for (int i = 0; i < 4; i++) {
                int x = bg_x + d[i][0];
                int y = bg_y + d[i][1];
                if (isGeneralValid(x, y)) {
                    black[cnt].x = x;
                    black[cnt].y = y;
                    cnt++;
                }
            }
            if (flyingGeneral(bg_x, bg_y)) {
                cout << "NO" << endl;
            } else {
                int flag = 1;
                for (int i = 0; i < cnt; i++) {
//                    char cc = board[black[i].x][black[i].y];
//                    if (cc != '\0') {
//                        board[black[i].x][black[i].y] = '\0';
//                    }
                    if (checkStmt(black[i])) {
                        flag = 0;
                        cout << "NO" << endl;
                        break;
                    }
//                    board[black[i].x][black[i].y] = cc;
                }
                if (flag) cout << "YES" << endl;
            }
        }
    }
};


#endif //ALGORITHM_22_1_SLN_L_Q2558_H
